home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / man / cat.1 / gawk.1 < prev    next >
Text File  |  1995-07-25  |  80KB  |  1,452 lines

  1.  
  2.  
  3.  
  4.      GGGGAAAAWWWWKKKK((((1111))))      FFFFrrrreeeeeeee SSSSooooffffttttwwwwaaaarrrreeee FFFFoooouuuunnnnddddaaaattttiiiioooonnnn ((((AAAApppprrrr 11118888 1111999999994444))))       GGGGAAAAWWWWKKKK((((1111))))
  5.  
  6.  
  7.  
  8.      NNNNAAAAMMMMEEEE
  9.           gawk - pattern scanning and processing language
  10.  
  11.      SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.           ggggaaaawwwwkkkk [ POSIX or GNU style options ] ----ffff _p_r_o_g_r_a_m-_f_i_l_e [ -------- ]
  13.           file ...
  14.           ggggaaaawwwwkkkk [ POSIX or GNU style options ] [ -------- ] _p_r_o_g_r_a_m-_t_e_x_t file
  15.           ...
  16.  
  17.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  18.           _G_a_w_k is the GNU Project's implementation of the AWK
  19.           programming language.  It conforms to the definition of the
  20.           language in the POSIX 1003.2 Command Language And Utilities
  21.           Standard.  This version in turn is based on the description
  22.           in _T_h_e _A_W_K _P_r_o_g_r_a_m_m_i_n_g _L_a_n_g_u_a_g_e, by Aho, Kernighan, and
  23.           Weinberger, with the additional features defined in the
  24.           System V Release 4 version of UNIX _a_w_k.  _G_a_w_k also provides
  25.           some GNU-specific extensions.
  26.  
  27.           The command line consists of options to _g_a_w_k itself, the AWK
  28.           program text (if not supplied via the ----ffff or --------ffffiiiilllleeee options),
  29.           and values to be made available in the AAAARRRRGGGGCCCC and AAAARRRRGGGGVVVV pre-
  30.           defined AWK variables.
  31.  
  32.      OOOOPPPPTTTTIIIIOOOONNNNSSSS
  33.           _G_a_w_k options may be either the traditional POSIX one letter
  34.           options, or the GNU style long options.  POSIX style options
  35.           start with a single ``-'', while GNU long options start with
  36.           ``--''.  GNU style long options are provided for both GNU-
  37.           specific features and for POSIX mandated features.  Other
  38.           implementations of the AWK language are likely to only
  39.           accept the traditional one letter options.
  40.  
  41.           Following the POSIX standard, _g_a_w_k-specific options are
  42.           supplied via arguments to the ----WWWW option.  Multiple ----WWWW
  43.           options may be supplied, or multiple arguments may be
  44.           supplied together if they are separated by commas, or
  45.           enclosed in quotes and separated by white space.  Case is
  46.           ignored in arguments to the ----WWWW option.  Each ----WWWW option has a
  47.           corresponding GNU style long option, as detailed below.
  48.           Arguments to GNU style long options are either joined with
  49.           the option by an ==== sign, with no intervening spaces, or they
  50.           may be provided in the next command line argument.
  51.  
  52.           _G_a_w_k accepts the following options.
  53.  
  54.           ----FFFF _f_s
  55.           --------ffffiiiieeeelllldddd----sssseeeeppppaaaarrrraaaattttoooorrrr====_f_s
  56.                Use _f_s for the input field separator (the value of the
  57.                FFFFSSSS predefined variable).
  58.  
  59.           ----vvvv _v_a_r====_v_a_l
  60.  
  61.  
  62.  
  63.      Page 1                                          (printed 7/11/94)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      GGGGAAAAWWWWKKKK((((1111))))      FFFFrrrreeeeeeee SSSSooooffffttttwwwwaaaarrrreeee FFFFoooouuuunnnnddddaaaattttiiiioooonnnn ((((AAAApppprrrr 11118888 1111999999994444))))       GGGGAAAAWWWWKKKK((((1111))))
  71.  
  72.  
  73.  
  74.           --------aaaassssssssiiiiggggnnnn====_v_a_r====_v_a_l
  75.                Assign the value _v_a_l, to the variable _v_a_r, before
  76.                execution of the program begins.  Such variable values
  77.                are available to the BBBBEEEEGGGGIIIINNNN block of an AWK program.
  78.  
  79.           ----ffff _p_r_o_g_r_a_m-_f_i_l_e
  80.           --------ffffiiiilllleeee====_p_r_o_g_r_a_m-_f_i_l_e
  81.                Read the AWK program source from the file _p_r_o_g_r_a_m-_f_i_l_e,
  82.                instead of from the first command line argument.
  83.                Multiple ----ffff (or --------ffffiiiilllleeee) options may be used.
  84.  
  85.           ----mmmmffff====_N_N_N
  86.           ----mmmmrrrr====_N_N_N
  87.                Set various memory limits to the value _N_N_N.  The ffff flag
  88.                sets the maximum number of fields, and the rrrr flag sets
  89.                the maximum record size.  These two flags and the ----mmmm
  90.                option are from the AT&T Bell Labs research version of
  91.                UNIX _a_w_k.  They are ignored by _g_a_w_k, since _g_a_w_k has no
  92.                pre-defined limits.
  93.           ----WWWW ccccoooommmmppppaaaatttt
  94.           --------ccccoooommmmppppaaaatttt    Run in _c_o_m_p_a_t_i_b_i_l_i_t_y mode.  In compatibility
  95.                       mode, _g_a_w_k behaves identically to UNIX _a_w_k; none
  96.                       of the GNU-specific extensions are recognized.
  97.                       See GGGGNNNNUUUU EEEEXXXXTTTTEEEENNNNSSSSIIIIOOOONNNNSSSS, below, for more information.
  98.  
  99.           ----WWWW ccccooooppppyyyylllleeeefffftttt
  100.           ----WWWW ccccooooppppyyyyrrrriiiigggghhhhtttt
  101.           --------ccccooooppppyyyylllleeeefffftttt
  102.           --------ccccooooppppyyyyrrrriiiigggghhhhtttt Print the short version of the GNU copyright
  103.                       information message on the error output.
  104.  
  105.           ----WWWW hhhheeeellllpppp
  106.           ----WWWW uuuussssaaaaggggeeee
  107.           --------hhhheeeellllpppp
  108.           --------uuuussssaaaaggggeeee     Print a relatively short summary of the
  109.                       available options on the error output.  Per the
  110.                       GNU Coding Standards, these options cause an
  111.                       immediate, successful exit.
  112.  
  113.           ----WWWW lllliiiinnnntttt
  114.           --------lllliiiinnnntttt      Provide warnings about constructs that are
  115.                       dubious or non-portable to other AWK
  116.                       implementations.
  117.           ----WWWW ppppoooossssiiiixxxx
  118.           --------ppppoooossssiiiixxxx     This turns on _c_o_m_p_a_t_i_b_i_l_i_t_y mode, with the
  119.                       following additional restrictions:
  120.  
  121.                       o+ \\\\xxxx escape sequences are not recognized.
  122.  
  123.                       o+ The synonym ffffuuuunnnncccc for the keyword ffffuuuunnnnccccttttiiiioooonnnn is
  124.                         not recognized.
  125.  
  126.  
  127.  
  128.  
  129.      Page 2                                          (printed 7/11/94)
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.      GGGGAAAAWWWWKKKK((((1111))))      FFFFrrrreeeeeeee SSSSooooffffttttwwwwaaaarrrreeee FFFFoooouuuunnnnddddaaaattttiiiioooonnnn ((((AAAApppprrrr 11118888 1111999999994444))))       GGGGAAAAWWWWKKKK((((1111))))
  137.  
  138.  
  139.  
  140.                       o+ The operators ******** and ********==== cannot be used in
  141.                         place of ^^^^ and ^^^^====.
  142.  
  143.           ----WWWW ssssoooouuuurrrrcccceeee====_p_r_o_g_r_a_m-_t_e_x_t
  144.           --------ssssoooouuuurrrrcccceeee====_p_r_o_g_r_a_m-_t_e_x_t
  145.                       Use _p_r_o_g_r_a_m-_t_e_x_t as AWK program source code.
  146.                       This option allows the easy intermixing of
  147.                       library functions (used via the ----ffff and --------ffffiiiilllleeee
  148.                       options) with source code entered on the command
  149.                       line.  It is intended primarily for medium to
  150.                       large size AWK programs used in shell scripts.
  151.                       The ----WWWW ssssoooouuuurrrrcccceeee==== form of this option uses the rest
  152.                       of the command line argument for _p_r_o_g_r_a_m-_t_e_x_t;
  153.                       no other options to ----WWWW will be recognized in the
  154.                       same argument.
  155.  
  156.           ----WWWW vvvveeeerrrrssssiiiioooonnnn
  157.           --------vvvveeeerrrrssssiiiioooonnnn   Print version information for this particular
  158.                       copy of _g_a_w_k on the error output.  This is
  159.                       useful mainly for knowing if the current copy of
  160.                       _g_a_w_k on your system is up to date with respect
  161.                       to whatever the Free Software Foundation is
  162.                       distributing.  Per the GNU Coding Standards,
  163.                       these options cause an immediate, successful
  164.                       exit.
  165.  
  166.           --------          Signal the end of options. This is useful to
  167.                       allow further arguments to the AWK program
  168.                       itself to start with a ``-''.  This is mainly
  169.                       for consistency with the argument parsing
  170.                       convention used by most other POSIX programs.
  171.  
  172.           In compatibility mode, any other options are flagged as
  173.           illegal, but are otherwise ignored.  In normal operation, as
  174.           long as program text has been supplied, unknown options are
  175.           passed on to the AWK program in the AAAARRRRGGGGVVVV array for
  176.           processing.  This is particularly useful for running AWK
  177.           programs via the ``#!'' executable interpreter mechanism.
  178.  
  179.      AAAAWWWWKKKK PPPPRRRROOOOGGGGRRRRAAAAMMMM EEEEXXXXEEEECCCCUUUUTTTTIIIIOOOONNNN
  180.           An AWK program consists of a sequence of pattern-action
  181.           statements and optional function definitions.
  182.  
  183.                _p_a_t_t_e_r_n   {{{{ _a_c_t_i_o_n _s_t_a_t_e_m_e_n_t_s }}}}
  184.                ffffuuuunnnnccccttttiiiioooonnnn _n_a_m_e((((_p_a_r_a_m_e_t_e_r _l_i_s_t)))) {{{{ _s_t_a_t_e_m_e_n_t_s }}}}
  185.  
  186.           _G_a_w_k first reads the program source from the _p_r_o_g_r_a_m-_f_i_l_e(s)
  187.           if specified, from arguments to ----WWWW ssssoooouuuurrrrcccceeee====, or from the
  188.           first non-option argument on the command line.  The ----ffff and
  189.           ----WWWW ssssoooouuuurrrrcccceeee==== options may be used multiple times on the command
  190.           line.  _G_a_w_k will read the program text as if all the
  191.           _p_r_o_g_r_a_m-_f_i_l_es and command line source texts had been
  192.  
  193.  
  194.      Page 3                                          (printed 7/11/94)
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.      GGGGAAAAWWWWKKKK((((1111))))      FFFFrrrreeeeeeee SSSSooooffffttttwwwwaaaarrrreeee FFFFoooouuuunnnnddddaaaattttiiiioooonnnn ((((AAAApppprrrr 11118888 1111999999994444))))       GGGGAAAAWWWWKKKK((((1111))))
  202.  
  203.  
  204.  
  205.           concatenated together.  This is useful for building
  206.           libraries of AWK functions, without having to include them
  207.           in each new AWK program that uses them.  It also provides
  208.           the ability to mix library functions with command line
  209.           programs.
  210.  
  211.           The environment variable AAAAWWWWKKKKPPPPAAAATTTTHHHH specifies a search path to
  212.           use when finding source files named with the ----ffff option.  If
  213.           this variable does not exist, the default path is
  214.           """"....::::////uuuussssrrrr////lllliiiibbbb////aaaawwwwkkkk::::////uuuussssrrrr////sssskkkkuuuunnnnkkkk////lllliiiibbbb////aaaawwwwkkkk"""".  If a file name given
  215.           to the ----ffff option contains a ``/'' character, no path search
  216.           is performed.
  217.  
  218.           _G_a_w_k executes AWK programs in the following order.  First,
  219.           all variable assignments specified via the ----vvvv option are
  220.           performed.  Next, _g_a_w_k compiles the program into an internal
  221.           form.  Then, _g_a_w_k executes the code in the BBBBEEEEGGGGIIIINNNN block(s)
  222.           (if any), and then proceeds to read each file named in the
  223.           AAAARRRRGGGGVVVV array.  If there are no files named on the command
  224.           line, _g_a_w_k reads the standard input.
  225.  
  226.           If a filename on the command line has the form _v_a_r====_v_a_l it is
  227.           treated as a variable assignment. The variable _v_a_r will be
  228.           assigned the value _v_a_l.  (This happens after any BBBBEEEEGGGGIIIINNNN
  229.           block(s) have been run.) Command line variable assignment is
  230.           most useful for dynamically assigning values to the
  231.           variables AWK uses to control how input is broken into
  232.           fields and records. It is also useful for controlling state
  233.           if multiple passes are needed over a single data file.
  234.  
  235.           If the value of a particular element of AAAARRRRGGGGVVVV is empty (""""""""),
  236.           _g_a_w_k skips over it.
  237.  
  238.           For each line in the input, _g_a_w_k tests to see if it matches
  239.           any _p_a_t_t_e_r_n in the AWK program.  For each pattern that the
  240.           line matches, the associated _a_c_t_i_o_n is executed.  The
  241.           patterns are tested in the order they occur in the program.
  242.  
  243.           Finally, after all the input is exhausted, _g_a_w_k executes the
  244.           code in the EEEENNNNDDDD block(s) (if any).
  245.  
  246.      VVVVAAAARRRRIIIIAAAABBBBLLLLEEEESSSS AAAANNNNDDDD FFFFIIIIEEEELLLLDDDDSSSS
  247.           AWK variables are dynamic; they come into existence when
  248.           they are first used. Their values are either floating-point
  249.           numbers or strings, or both, depending upon how they are
  250.           used. AWK also has one dimensional arrays; arrays with
  251.           multiple dimensions may be simulated.  Several pre-defined
  252.           variables are set as a program runs; these will be described
  253.           as needed and summarized below.
  254.  
  255.         FFFFiiiieeeellllddddssss
  256.           As each input line is read, _g_a_w_k splits the line into
  257.  
  258.  
  259.  
  260.      Page 4                                          (printed 7/11/94)
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.      GGGGAAAAWWWWKKKK((((1111))))      FFFFrrrreeeeeeee SSSSooooffffttttwwwwaaaarrrreeee FFFFoooouuuunnnnddddaaaattttiiiioooonnnn ((((AAAApppprrrr 11118888 1111999999994444))))       GGGGAAAAWWWWKKKK((((1111))))
  268.  
  269.  
  270.  
  271.           _f_i_e_l_d_s, using the value of the FFFFSSSS variable as the field
  272.           separator.  If FFFFSSSS is a single character, fields are
  273.           separated by that character.  Otherwise, FFFFSSSS is expected to
  274.           be a full regular expression.  In the special case that FFFFSSSS
  275.           is a single blank, fields are separated by runs of blanks
  276.           and/or tabs.  Note that the value of IIIIGGGGNNNNOOOORRRREEEECCCCAAAASSSSEEEE (see below)
  277.           will also affect how fields are split when FFFFSSSS is a regular
  278.           expression.
  279.  
  280.           If the FFFFIIIIEEEELLLLDDDDWWWWIIIIDDDDTTTTHHHHSSSS variable is set to a space separated list
  281.           of numbers, each field is expected to have fixed width, and
  282.           _g_a_w_k will split up the record using the specified widths.
  283.           The value of FFFFSSSS is ignored.  Assigning a new value to FFFFSSSS
  284.           overrides the use of FFFFIIIIEEEELLLLDDDDWWWWIIIIDDDDTTTTHHHHSSSS, and restores the default
  285.           behavior.
  286.  
  287.           Each field in the input line may be referenced by its
  288.           position, $$$$1111, $$$$2222, and so on.  $$$$0000 is the whole line. The
  289.           value of a field may be assigned to as well.  Fields need
  290.           not be referenced by constants:
  291.  
  292.                nnnn ==== 5555
  293.                pppprrrriiiinnnntttt $$$$nnnn
  294.  
  295.           prints the fifth field in the input line.  The variable NNNNFFFF
  296.           is set to the total number of fields in the input line.
  297.  
  298.           References to non-existent fields (i.e. fields after $$$$NNNNFFFF)
  299.           produce the null-string. However, assigning to a non-
  300.           existent field (e.g., $$$$((((NNNNFFFF++++2222)))) ==== 5555) will increase the value
  301.           of NNNNFFFF, create any intervening fields with the null string as
  302.           their value, and cause the value of $$$$0000 to be recomputed,
  303.           with the fields being separated by the value of OOOOFFFFSSSS.
  304.           References to negative numbered fields cause a fatal error.
  305.  
  306.         BBBBuuuuiiiilllltttt----iiiinnnn VVVVaaaarrrriiiiaaaabbbblllleeeessss
  307.           AWK's built-in variables are:
  308.  
  309.           AAAARRRRGGGGCCCC        The number of command line arguments (does not
  310.                       include options to _g_a_w_k, or the program source).
  311.  
  312.           AAAARRRRGGGGIIIINNNNDDDD      The index in AAAARRRRGGGGVVVV of the current file being
  313.                       processed.
  314.  
  315.           AAAARRRRGGGGVVVV        Array of command line arguments. The array is
  316.                       indexed from 0 to AAAARRRRGGGGCCCC - 1.  Dynamically
  317.                       changing the contents of AAAARRRRGGGGVVVV can control the
  318.                       files used for data.
  319.  
  320.           CCCCOOOONNNNVVVVFFFFMMMMTTTT     The conversion format for numbers, """"%%%%....6666gggg"""", by
  321.                       default.
  322.  
  323.  
  324.  
  325.  
  326.      Page 5                                          (printed 7/11/94)
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.      GGGGAAAAWWWWKKKK((((1111))))      FFFFrrrreeeeeeee SSSSooooffffttttwwwwaaaarrrreeee FFFFoooouuuunnnnddddaaaattttiiiioooonnnn ((((AAAApppprrrr 11118888 1111999999994444))))       GGGGAAAAWWWWKKKK((((1111))))
  334.  
  335.  
  336.  
  337.           EEEENNNNVVVVIIIIRRRROOOONNNN     An array containing the values of the current
  338.                       environment.  The array is indexed by the
  339.                       environment variables, each element being the
  340.                       value of that variable (e.g., EEEENNNNVVVVIIIIRRRROOOONNNN[[[[""""HHHHOOOOMMMMEEEE""""]]]]
  341.                       might be ////uuuu////aaaarrrrnnnnoooolllldddd).  Changing this array does
  342.                       not affect the environment seen by programs
  343.                       which _g_a_w_k spawns via redirection or the
  344.                       ssssyyyysssstttteeeemmmm(((()))) function.  (This may change in a future
  345.                       version of _g_a_w_k.)
  346.  
  347.           EEEERRRRRRRRNNNNOOOO       If a system error occurs either doing a
  348.                       redirection for ggggeeeettttlllliiiinnnneeee, during a read for
  349.                       ggggeeeettttlllliiiinnnneeee, or during a cccclllloooosssseeee(((()))), then EEEERRRRRRRRNNNNOOOO will
  350.                       contain a string describing the error.
  351.  
  352.           FFFFIIIIEEEELLLLDDDDWWWWIIIIDDDDTTTTHHHHSSSS A white-space separated list of fieldwidths.
  353.                       When set, _g_a_w_k parses the input into fields of
  354.                       fixed width, instead of using the value of the
  355.                       FFFFSSSS variable as the field separator.  The fixed
  356.                       field width facility is still experimental;
  357.                       expect the semantics to change as _g_a_w_k evolves
  358.                       over time.
  359.  
  360.           FFFFIIIILLLLEEEENNNNAAAAMMMMEEEE    The name of the current input file.  If no files
  361.                       are specified on the command line, the value of
  362.                       FFFFIIIILLLLEEEENNNNAAAAMMMMEEEE is ``-''.  However, FFFFIIIILLLLEEEENNNNAAAAMMMMEEEE is
  363.                       undefined inside the BBBBEEEEGGGGIIIINNNN block.
  364.  
  365.           FFFFNNNNRRRR         The input record number in the current input
  366.                       file.
  367.  
  368.           FFFFSSSS          The input field separator, a blank by default.
  369.  
  370.           IIIIGGGGNNNNOOOORRRREEEECCCCAAAASSSSEEEE  Controls the case-sensitivity of all regular
  371.                       expression operations. If IIIIGGGGNNNNOOOORRRREEEECCCCAAAASSSSEEEE has a non-
  372.                       zero value, then pattern matching in rules,
  373.                       field splitting with FFFFSSSS, regular expression
  374.                       matching with ~~~~ and !!!!~~~~, and the ggggssssuuuubbbb(((()))), iiiinnnnddddeeeexxxx(((()))),
  375.                       mmmmaaaattttcccchhhh(((()))), sssspppplllliiiitttt(((()))), and ssssuuuubbbb(((()))) pre-defined
  376.                       functions will all ignore case when doing
  377.                       regular expression operations.  Thus, if
  378.                       IIIIGGGGNNNNOOOORRRREEEECCCCAAAASSSSEEEE is not equal to zero, ////aaaaBBBB//// matches
  379.                       all of the strings """"aaaabbbb"""", """"aaaaBBBB"""", """"AAAAbbbb"""", and """"AAAABBBB"""".
  380.                       As with all AWK variables, the initial value of
  381.                       IIIIGGGGNNNNOOOORRRREEEECCCCAAAASSSSEEEE is zero, so all regular expression
  382.                       operations are normally case-sensitive.
  383.  
  384.           NNNNFFFF          The number of fields in the current input
  385.                       record.
  386.  
  387.           NNNNRRRR          The total number of input records seen so far.
  388.  
  389.  
  390.  
  391.  
  392.      Page 6                                          (printed 7/11/94)
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.      GGGGAAAAWWWWKKKK((((1111))))      FFFFrrrreeeeeeee SSSSooooffffttttwwwwaaaarrrreeee FFFFoooouuuunnnnddddaaaattttiiiioooonnnn ((((AAAApppprrrr 11118888 1111999999994444))))       GGGGAAAAWWWWKKKK((((1111))))
  400.  
  401.  
  402.  
  403.           OOOOFFFFMMMMTTTT        The output format for numbers, """"%%%%....6666gggg"""", by
  404.                       default.
  405.  
  406.           OOOOFFFFSSSS         The output field separator, a blank by default.
  407.  
  408.           OOOORRRRSSSS         The output record separator, by default a
  409.                       newline.
  410.  
  411.           RRRRSSSS          The input record separator, by default a
  412.                       newline.  RRRRSSSS is exceptional in that only the
  413.                       first character of its string value is used for
  414.                       separating records.  (This will probably change
  415.                       in a future release of _g_a_w_k.) If RRRRSSSS is set to
  416.                       the null string, then records are separated by
  417.                       blank lines.  When RRRRSSSS is set to the null string,
  418.                       then the newline character always acts as a
  419.                       field separator, in addition to whatever value
  420.                       FFFFSSSS may have.
  421.  
  422.           RRRRSSSSTTTTAAAARRRRTTTT      The index of the first character matched by
  423.                       mmmmaaaattttcccchhhh(((()))); 0 if no match.
  424.  
  425.           RRRRLLLLEEEENNNNGGGGTTTTHHHH     The length of the string matched by mmmmaaaattttcccchhhh(((()))); -1
  426.                       if no match.
  427.  
  428.           SSSSUUUUBBBBSSSSEEEEPPPP      The character used to separate multiple
  429.                       subscripts in array elements, by default """"\\\\000033334444"""".
  430.  
  431.         AAAArrrrrrrraaaayyyyssss
  432.           Arrays are subscripted with an expression between square
  433.           brackets ([[[[ and ]]]]).  If the expression is an expression list
  434.           (_e_x_p_r, _e_x_p_r ...) then the array subscript is a string
  435.           consisting of the concatenation of the (string) value of
  436.           each expression, separated by the value of the SSSSUUUUBBBBSSSSEEEEPPPP
  437.           variable.  This facility is used to simulate multiply
  438.           dimensioned arrays. For example:
  439.  
  440.                iiii ==== """"AAAA"""" ;;;; jjjj ==== """"BBBB"""" ;;;; kkkk ==== """"CCCC""""
  441.                xxxx[[[[iiii,,,, jjjj,,,, kkkk]]]] ==== """"hhhheeeelllllllloooo,,,, wwwwoooorrrrlllldddd\\\\nnnn""""
  442.  
  443.           assigns the string """"hhhheeeelllllllloooo,,,, wwwwoooorrrrlllldddd\\\\nnnn"""" to the element of the
  444.           array xxxx which is indexed by the string """"AAAA\\\\000033334444BBBB\\\\000033334444CCCC"""". All
  445.           arrays in AWK are associative, i.e. indexed by string
  446.           values.
  447.  
  448.           The special operator iiiinnnn may be used in an iiiiffff or wwwwhhhhiiiilllleeee
  449.           statement to see if an array has an index consisting of a
  450.           particular value.
  451.  
  452.                iiiiffff ((((vvvvaaaallll iiiinnnn aaaarrrrrrrraaaayyyy))))
  453.                     pppprrrriiiinnnntttt aaaarrrrrrrraaaayyyy[[[[vvvvaaaallll]]]]
  454.  
  455.  
  456.  
  457.  
  458.      Page 7                                          (printed 7/11/94)
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465.      GGGGAAAAWWWWKKKK((((1111))))      FFFFrrrreeeeeeee SSSSooooffffttttwwwwaaaarrrreeee FFFFoooouuuunnnnddddaaaattttiiiioooonnnn ((((AAAApppprrrr 11118888 1111999999994444))))       GGGGAAAAWWWWKKKK((((1111))))
  466.  
  467.  
  468.  
  469.           If the array has multiple subscripts, use ((((iiii,,,, jjjj)))) iiiinnnn aaaarrrrrrrraaaayyyy.
  470.  
  471.           The iiiinnnn construct may also be used in a ffffoooorrrr loop to iterate
  472.           over all the elements of an array.
  473.  
  474.           An element may be deleted from an array using the ddddeeeelllleeeetttteeee
  475.           statement.  The ddddeeeelllleeeetttteeee statement may also be used to delete
  476.           the entire contents of an array.
  477.  
  478.         VVVVaaaarrrriiiiaaaabbbblllleeee TTTTyyyyppppiiiinnnngggg AAAAnnnndddd CCCCoooonnnnvvvveeeerrrrssssiiiioooonnnn
  479.           Variables and fields may be (floating point) numbers, or
  480.           strings, or both. How the value of a variable is interpreted
  481.           depends upon its context. If used in a numeric expression,
  482.           it will be treated as a number, if used as a string it will
  483.           be treated as a string.
  484.  
  485.           To force a variable to be treated as a number, add 0 to it;
  486.           to force it to be treated as a string, concatenate it with
  487.           the null string.
  488.  
  489.           When a string must be converted to a number, the conversion
  490.           is accomplished using _a_t_o_f(3).  A number is converted to a
  491.           string by using the value of CCCCOOOONNNNVVVVFFFFMMMMTTTT as a format string for
  492.           _s_p_r_i_n_t_f(3), with the numeric value of the variable as the
  493.           argument.  However, even though all numbers in AWK are
  494.           floating-point, integral values are _a_l_w_a_y_s converted as
  495.           integers.  Thus, given
  496.  
  497.                CCCCOOOONNNNVVVVFFFFMMMMTTTT ==== """"%%%%2222....2222ffff""""
  498.                aaaa ==== 11112222
  499.                bbbb ==== aaaa """"""""
  500.  
  501.           the variable bbbb has a string value of """"11112222"""" and not """"11112222....00000000"""".
  502.  
  503.           _G_a_w_k performs comparisons as follows: If two variables are
  504.           numeric, they are compared numerically.  If one value is
  505.           numeric and the other has a string value that is a ``numeric
  506.           string,'' then comparisons are also done numerically.
  507.           Otherwise, the numeric value is converted to a string and a
  508.           string comparison is performed.  Two strings are compared,
  509.           of course, as strings.  According to the POSIX standard,
  510.           even if two strings are numeric strings, a numeric
  511.           comparison is performed.  However, this is clearly
  512.           incorrect, and _g_a_w_k does not do this.
  513.  
  514.           Uninitialized variables have the numeric value 0 and the
  515.           string value "" (the null, or empty, string).
  516.  
  517.      PPPPAAAATTTTTTTTEEEERRRRNNNNSSSS AAAANNNNDDDD AAAACCCCTTTTIIIIOOOONNNNSSSS
  518.           AWK is a line oriented language. The pattern comes first,
  519.           and then the action. Action statements are enclosed in {{{{ and
  520.           }}}}.  Either the pattern may be missing, or the action may be
  521.  
  522.  
  523.  
  524.      Page 8                                          (printed 7/11/94)
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.      GGGGAAAAWWWWKKKK((((1111))))      FFFFrrrreeeeeeee SSSSooooffffttttwwwwaaaarrrreeee FFFFoooouuuunnnnddddaaaattttiiiioooonnnn ((((AAAApppprrrr 11118888 1111999999994444))))       GGGGAAAAWWWWKKKK((((1111))))
  532.  
  533.  
  534.  
  535.           missing, but, of course, not both. If the pattern is
  536.           missing, the action will be executed for every single line
  537.           of input.  A missing action is equivalent to
  538.  
  539.                {{{{ pppprrrriiiinnnntttt }}}}
  540.  
  541.           which prints the entire line.
  542.  
  543.           Comments begin with the ``#'' character, and continue until
  544.           the end of the line.  Blank lines may be used to separate
  545.           statements.  Normally, a statement ends with a newline,
  546.           however, this is not the case for lines ending in a ``,'',
  547.           ``{'', ``?'', ``:'', ``&&'', or ``||''.  Lines ending in ddddoooo
  548.           or eeeellllsssseeee also have their statements automatically continued
  549.           on the following line.  In other cases, a line can be
  550.           continued by ending it with a ``\'', in which case the
  551.           newline will be ignored.
  552.  
  553.           Multiple statements may be put on one line by separating
  554.           them with a ``;''.  This applies to both the statements
  555.           within the action part of a pattern-action pair (the usual
  556.           case), and to the pattern-action statements themselves.
  557.  
  558.         PPPPaaaatttttttteeeerrrrnnnnssss
  559.           AWK patterns may be one of the following:
  560.  
  561.                BBBBEEEEGGGGIIIINNNN
  562.                EEEENNNNDDDD
  563.                ////_r_e_g_u_l_a_r _e_x_p_r_e_s_s_i_o_n////
  564.                _r_e_l_a_t_i_o_n_a_l _e_x_p_r_e_s_s_i_o_n
  565.                _p_a_t_t_e_r_n &&&&&&&& _p_a_t_t_e_r_n
  566.                _p_a_t_t_e_r_n |||||||| _p_a_t_t_e_r_n
  567.                _p_a_t_t_e_r_n ???? _p_a_t_t_e_r_n :::: _p_a_t_t_e_r_n
  568.                ((((_p_a_t_t_e_r_n))))
  569.                !!!! _p_a_t_t_e_r_n
  570.                _p_a_t_t_e_r_n_1,,,, _p_a_t_t_e_r_n_2
  571.  
  572.           BBBBEEEEGGGGIIIINNNN and EEEENNNNDDDD are two special kinds of patterns which are
  573.           not tested against the input.  The action parts of all BBBBEEEEGGGGIIIINNNN
  574.           patterns are merged as if all the statements had been
  575.           written in a single BBBBEEEEGGGGIIIINNNN block. They are executed before
  576.           any of the input is read. Similarly, all the EEEENNNNDDDD blocks are
  577.           merged, and executed when all the input is exhausted (or
  578.           when an eeeexxxxiiiitttt statement is executed).  BBBBEEEEGGGGIIIINNNN and EEEENNNNDDDD patterns
  579.           cannot be combined with other patterns in pattern
  580.           expressions.  BBBBEEEEGGGGIIIINNNN and EEEENNNNDDDD patterns cannot have missing
  581.           action parts.
  582.  
  583.           For ////_r_e_g_u_l_a_r _e_x_p_r_e_s_s_i_o_n//// patterns, the associated statement
  584.           is executed for each input line that matches the regular
  585.           expression.  Regular expressions are the same as those in
  586.           _e_g_r_e_p(1), and are summarized below.
  587.  
  588.  
  589.  
  590.      Page 9                                          (printed 7/11/94)
  591.  
  592.  
  593.  
  594.  
  595.  
  596.  
  597.      GGGGAAAAWWWWKKKK((((1111))))      FFFFrrrreeeeeeee SSSSooooffffttttwwwwaaaarrrreeee FFFFoooouuuunnnnddddaaaattttiiiioooonnnn ((((AAAApppprrrr 11118888 1111999999994444))))       GGGGAAAAWWWWKKKK((((1111))))
  598.  
  599.  
  600.  
  601.           A _r_e_l_a_t_i_o_n_a_l _e_x_p_r_e_s_s_i_o_n may use any of the operators defined
  602.           below in the section on actions.  These generally test
  603.           whether certain fields match certain regular expressions.
  604.  
  605.           The &&&&&&&&, ||||||||, and !!!! operators are logical AND, logical OR, and
  606.           logical NOT, respectively, as in C.  They do short-circuit
  607.           evaluation, also as in C, and are used for combining more
  608.           primitive pattern expressions. As in most languages,
  609.           parentheses may be used to change the order of evaluation.
  610.  
  611.           The ????:::: operator is like the same operator in C. If the first
  612.           pattern is true then the pattern used for testing is the
  613.           second pattern, otherwise it is the third. Only one of the
  614.           second and third patterns is evaluated.
  615.  
  616.           The _p_a_t_t_e_r_n_1,,,, _p_a_t_t_e_r_n_2 form of an expression is called a
  617.           _r_a_n_g_e _p_a_t_t_e_r_n.  It matches all input records starting with a
  618.           line that matches _p_a_t_t_e_r_n_1, and continuing until a record
  619.           that matches _p_a_t_t_e_r_n_2, inclusive. It does not combine with
  620.           any other sort of pattern expression.
  621.  
  622.         RRRReeeegggguuuullllaaaarrrr EEEExxxxpppprrrreeeessssssssiiiioooonnnnssss
  623.           Regular expressions are the extended kind found in _e_g_r_e_p.
  624.           They are composed of characters as follows:
  625.  
  626.           _c          matches the non-metacharacter _c.
  627.  
  628.           _\_c         matches the literal character _c.
  629.  
  630.           ....          matches any character except newline.
  631.  
  632.           ^^^^          matches the beginning of a line or a string.
  633.  
  634.           $$$$          matches the end of a line or a string.
  635.  
  636.           [[[[_a_b_c...]]]]   character class, matches any of the characters
  637.                      _a_b_c....
  638.  
  639.           [[[[^^^^_a_b_c...]]]]  negated character class, matches any character
  640.                      except _a_b_c... and newline.
  641.  
  642.           _r_1||||_r_2      alternation: matches either _r_1 or _r_2.
  643.  
  644.           _r_1_r_2       concatenation: matches _r_1, and then _r_2.
  645.  
  646.           _r++++         matches one or more _r's.
  647.  
  648.           _r****         matches zero or more _r's.
  649.  
  650.           _r????         matches zero or one _r's.
  651.  
  652.           ((((_r))))        grouping: matches _r.
  653.  
  654.  
  655.  
  656.      Page 10                                         (printed 7/11/94)
  657.  
  658.  
  659.  
  660.  
  661.  
  662.  
  663.      GGGGAAAAWWWWKKKK((((1111))))      FFFFrrrreeeeeeee SSSSooooffffttttwwwwaaaarrrreeee FFFFoooouuuunnnnddddaaaattttiiiioooonnnn ((((AAAApppprrrr 11118888 1111999999994444))))       GGGGAAAAWWWWKKKK((((1111))))
  664.  
  665.  
  666.  
  667.           The escape sequences that are valid in string constants (see
  668.           below) are also legal in regular expressions.
  669.  
  670.         AAAAccccttttiiiioooonnnnssss
  671.           Action statements are enclosed in braces, {{{{ and }}}}.  Action
  672.           statements consist of the usual assignment, conditional, and
  673.           looping statements found in most languages. The operators,
  674.           control statements, and input/output statements available
  675.           are patterned after those in C.
  676.  
  677.         OOOOppppeeeerrrraaaattttoooorrrrssss
  678.           The operators in AWK, in order of increasing precedence, are
  679.  
  680.           ==== ++++==== ----====
  681.           ****==== ////==== %%%%==== ^^^^==== Assignment. Both absolute assignment ((((_v_a_r ====
  682.                       _v_a_l_u_e)))) and operator-assignment (the other forms)
  683.                       are supported.
  684.  
  685.           ????::::          The C conditional expression. This has the form
  686.                       _e_x_p_r_1 ???? _e_x_p_r_2 :::: _e_x_p_r_3. If _e_x_p_r_1 is true, the
  687.                       value of the expression is _e_x_p_r_2, otherwise it
  688.                       is _e_x_p_r_3.  Only one of _e_x_p_r_2 and _e_x_p_r_3 is
  689.                       evaluated.
  690.  
  691.           ||||||||          Logical OR.
  692.  
  693.           &&&&&&&&          Logical AND.
  694.  
  695.           ~~~~ !!!!~~~~        Regular expression match, negated match.  NNNNOOOOTTTTEEEE::::
  696.                       Do not use a constant regular expression (////ffffoooooooo////)
  697.                       on the left-hand side of a ~~~~ or !!!!~~~~.  Only use
  698.                       one on the right-hand side.  The expression
  699.                       ////ffffoooooooo//// ~~~~ _e_x_p has the same meaning as (((((((($$$$0000 ~~~~
  700.                       ////ffffoooooooo////)))) ~~~~ _e_x_p)))).  This is usually _n_o_t what was
  701.                       intended.
  702.  
  703.           <<<< >>>>
  704.           <<<<==== >>>>====
  705.           !!!!==== ========       The regular relational operators.
  706.  
  707.           _b_l_a_n_k       String concatenation.
  708.  
  709.           ++++ ----         Addition and subtraction.
  710.  
  711.           **** //// %%%%       Multiplication, division, and modulus.
  712.  
  713.           ++++ ---- !!!!       Unary plus, unary minus, and logical negation.
  714.  
  715.           ^^^^           Exponentiation (******** may also be used, and ********==== for
  716.                       the assignment operator).
  717.  
  718.           ++++++++ --------       Increment and decrement, both prefix and
  719.  
  720.  
  721.  
  722.      Page 11                                         (printed 7/11/94)
  723.  
  724.  
  725.  
  726.  
  727.  
  728.  
  729.      GGGGAAAAWWWWKKKK((((1111))))      FFFFrrrreeeeeeee SSSSooooffffttttwwwwaaaarrrreeee FFFFoooouuuunnnnddddaaaattttiiiioooonnnn ((((AAAApppprrrr 11118888 1111999999994444))))       GGGGAAAAWWWWKKKK((((1111))))
  730.  
  731.  
  732.  
  733.                       postfix.
  734.  
  735.           $$$$           Field reference.
  736.  
  737.         CCCCoooonnnnttttrrrroooollll SSSSttttaaaatttteeeemmmmeeeennnnttttssss
  738.           The control statements are as follows:
  739.  
  740.                iiiiffff ((((_c_o_n_d_i_t_i_o_n)))) _s_t_a_t_e_m_e_n_t [ eeeellllsssseeee _s_t_a_t_e_m_e_n_t ]
  741.                wwwwhhhhiiiilllleeee ((((_c_o_n_d_i_t_i_o_n)))) _s_t_a_t_e_m_e_n_t
  742.                ddddoooo _s_t_a_t_e_m_e_n_t wwwwhhhhiiiilllleeee ((((_c_o_n_d_i_t_i_o_n))))
  743.                ffffoooorrrr ((((_e_x_p_r_1;;;; _e_x_p_r_2;;;; _e_x_p_r_3)))) _s_t_a_t_e_m_e_n_t
  744.                ffffoooorrrr ((((_v_a_r iiiinnnn _a_r_r_a_y)))) _s_t_a_t_e_m_e_n_t
  745.                bbbbrrrreeeeaaaakkkk
  746.                ccccoooonnnnttttiiiinnnnuuuueeee
  747.                ddddeeeelllleeeetttteeee _a_r_r_a_y[[[[_i_n_d_e_x]]]]
  748.                ddddeeeelllleeeetttteeee _a_r_r_a_y
  749.                eeeexxxxiiiitttt [ _e_x_p_r_e_s_s_i_o_n ]
  750.                {{{{ _s_t_a_t_e_m_e_n_t_s }}}}
  751.  
  752.         IIII////OOOO SSSSttttaaaatttteeeemmmmeeeennnnttttssss
  753.           The input/output statements are as follows:
  754.  
  755.           cccclllloooosssseeee((((_f_i_l_e_n_a_m_e))))       Close file (or pipe, see below).
  756.  
  757.           ggggeeeettttlllliiiinnnneeee               Set $$$$0000 from next input record; set NNNNFFFF,
  758.                                 NNNNRRRR, FFFFNNNNRRRR.
  759.  
  760.           ggggeeeettttlllliiiinnnneeee <<<<_f_i_l_e         Set $$$$0000 from next record of _f_i_l_e; set
  761.                                 NNNNFFFF.
  762.  
  763.           ggggeeeettttlllliiiinnnneeee _v_a_r           Set _v_a_r from next input record; set
  764.                                 NNNNFFFF, FFFFNNNNRRRR.
  765.  
  766.           ggggeeeettttlllliiiinnnneeee _v_a_r <<<<_f_i_l_e     Set _v_a_r from next record of _f_i_l_e.
  767.  
  768.           nnnneeeexxxxtttt                  Stop processing the current input
  769.                                 record. The next input record is read
  770.                                 and processing starts over with the
  771.                                 first pattern in the AWK program. If
  772.                                 the end of the input data is reached,
  773.                                 the EEEENNNNDDDD block(s), if any, are
  774.                                 executed.
  775.  
  776.           nnnneeeexxxxtttt ffffiiiilllleeee             Stop processing the current input
  777.                                 file.  The next input record read
  778.                                 comes from the next input file.
  779.                                 FFFFIIIILLLLEEEENNNNAAAAMMMMEEEE is updated, FFFFNNNNRRRR is reset to
  780.                                 1, and processing starts over with the
  781.                                 first pattern in the AWK program. If
  782.                                 the end of the input data is reached,
  783.                                 the EEEENNNNDDDD block(s), if any, are
  784.                                 executed.
  785.  
  786.  
  787.  
  788.      Page 12                                         (printed 7/11/94)
  789.  
  790.  
  791.  
  792.  
  793.  
  794.  
  795.      GGGGAAAAWWWWKKKK((((1111))))      FFFFrrrreeeeeeee SSSSooooffffttttwwwwaaaarrrreeee FFFFoooouuuunnnnddddaaaattttiiiioooonnnn ((((AAAApppprrrr 11118888 1111999999994444))))       GGGGAAAAWWWWKKKK((((1111))))
  796.  
  797.  
  798.  
  799.           pppprrrriiiinnnntttt                 Prints the current record.
  800.  
  801.           pppprrrriiiinnnntttt _e_x_p_r-_l_i_s_t       Prints expressions.  Each expression
  802.                                 is separated by the value of the OOOOFFFFSSSS
  803.                                 variable. The output record is
  804.                                 terminated with the value of the OOOORRRRSSSS
  805.                                 variable.
  806.  
  807.           pppprrrriiiinnnntttt _e_x_p_r-_l_i_s_t >>>>_f_i_l_e Prints expressions on _f_i_l_e.  Each
  808.                                 expression is separated by the value
  809.                                 of the OOOOFFFFSSSS variable. The output record
  810.                                 is terminated with the value of the
  811.                                 OOOORRRRSSSS variable.
  812.  
  813.           pppprrrriiiinnnnttttffff _f_m_t, _e_x_p_r-_l_i_s_t Format and print.
  814.  
  815.           pppprrrriiiinnnnttttffff _f_m_t, _e_x_p_r-_l_i_s_t >>>>_f_i_l_e
  816.                                 Format and print on _f_i_l_e.
  817.  
  818.           ssssyyyysssstttteeeemmmm((((_c_m_d-_l_i_n_e))))      Execute the command _c_m_d-_l_i_n_e, and
  819.                                 return the exit status.  (This may not
  820.                                 be available on non-POSIX systems.)
  821.  
  822.           Other input/output redirections are also allowed. For pppprrrriiiinnnntttt
  823.           and pppprrrriiiinnnnttttffff, >>>>>>>>_f_i_l_e appends output to the _f_i_l_e, while ||||
  824.           _c_o_m_m_a_n_d writes on a pipe.  In a similar fashion, _c_o_m_m_a_n_d ||||
  825.           ggggeeeettttlllliiiinnnneeee pipes into ggggeeeettttlllliiiinnnneeee.  The ggggeeeettttlllliiiinnnneeee command will return
  826.           0 on end of file, and -1 on an error.
  827.  
  828.         TTTThhhheeee _p_r_i_n_t_f SSSSttttaaaatttteeeemmmmeeeennnntttt
  829.           The AWK versions of the pppprrrriiiinnnnttttffff statement and sssspppprrrriiiinnnnttttffff(((())))
  830.           function (see below) accept the following conversion
  831.           specification formats:
  832.  
  833.           %%%%cccc   An ASCII character.  If the argument used for %%%%cccc is
  834.                numeric, it is treated as a character and printed.
  835.                Otherwise, the argument is assumed to be a string, and
  836.                the only first character of that string is printed.
  837.  
  838.           %%%%dddd   A decimal number (the integer part).
  839.  
  840.           %%%%iiii   Just like %%%%dddd.
  841.  
  842.           %%%%eeee   A floating point number of the form [[[[----]]]]dddd....ddddddddddddddddddddddddEEEE[[[[++++----]]]]dddddddd.
  843.  
  844.           %%%%ffff   A floating point number of the form [[[[----]]]]dddddddddddd....dddddddddddddddddddddddd.
  845.  
  846.           %%%%gggg   Use eeee or ffff conversion, whichever is shorter, with
  847.                nonsignificant zeros suppressed.
  848.  
  849.           %%%%oooo   An unsigned octal number (again, an integer).
  850.  
  851.  
  852.  
  853.  
  854.      Page 13                                         (printed 7/11/94)
  855.  
  856.  
  857.  
  858.  
  859.  
  860.  
  861.      GGGGAAAAWWWWKKKK((((1111))))      FFFFrrrreeeeeeee SSSSooooffffttttwwwwaaaarrrreeee FFFFoooouuuunnnnddddaaaattttiiiioooonnnn ((((AAAApppprrrr 11118888 1111999999994444))))       GGGGAAAAWWWWKKKK((((1111))))
  862.  
  863.  
  864.  
  865.           %%%%ssss   A character string.
  866.  
  867.           %%%%xxxx   An unsigned hexadecimal number (an integer).
  868.  
  869.           %%%%XXXX   Like %%%%xxxx, but using AAAABBBBCCCCDDDDEEEEFFFF instead of aaaabbbbccccddddeeeeffff.
  870.  
  871.           %%%%%%%%   A single %%%% character; no argument is converted.
  872.  
  873.           There are optional, additional parameters that may lie
  874.           between the %%%% and the control letter:
  875.  
  876.           ----    The expression should be left-justified within its
  877.                field.
  878.  
  879.           _w_i_d_t_h
  880.                The field should be padded to this width. If the number
  881.                has a leading zero, then the field will be padded with
  882.                zeros.  Otherwise it is padded with blanks.  This
  883.                applies even to the non-numeric output formats.
  884.  
  885.           ...._p_r_e_c
  886.                A number indicating the maximum width of strings or
  887.                digits to the right of the decimal point.
  888.  
  889.           The dynamic _w_i_d_t_h and _p_r_e_c capabilities of the ANSI C
  890.           pppprrrriiiinnnnttttffff(((()))) routines are supported.  A **** in place of either the
  891.           wwwwiiiiddddtttthhhh or pppprrrreeeecccc specifications will cause their values to be
  892.           taken from the argument list to pppprrrriiiinnnnttttffff or sssspppprrrriiiinnnnttttffff(((()))).
  893.  
  894.         SSSSppppeeeecccciiiiaaaallll FFFFiiiilllleeee NNNNaaaammmmeeeessss
  895.           When doing I/O redirection from either pppprrrriiiinnnntttt or pppprrrriiiinnnnttttffff into
  896.           a file, or via ggggeeeettttlllliiiinnnneeee from a file, _g_a_w_k recognizes certain
  897.           special filenames internally.  These filenames allow access
  898.           to open file descriptors inherited from _g_a_w_k's parent
  899.           process (usually the shell).  Other special filenames
  900.           provide access information about the running ggggaaaawwwwkkkk process.
  901.           The filenames are:
  902.  
  903.           ////ddddeeeevvvv////ppppiiiidddd    Reading this file returns the process ID of the
  904.                       current process, in decimal, terminated with a
  905.                       newline.
  906.  
  907.           ////ddddeeeevvvv////ppppppppiiiidddd   Reading this file returns the parent process ID
  908.                       of the current process, in decimal, terminated
  909.                       with a newline.
  910.  
  911.           ////ddddeeeevvvv////ppppggggrrrrppppiiiidddd Reading this file returns the process group ID
  912.                       of the current process, in decimal, terminated
  913.                       with a newline.
  914.  
  915.           ////ddddeeeevvvv////uuuusssseeeerrrr   Reading this file returns a single record
  916.                       terminated with a newline.  The fields are
  917.  
  918.  
  919.  
  920.      Page 14                                         (printed 7/11/94)
  921.  
  922.  
  923.  
  924.  
  925.  
  926.  
  927.      GGGGAAAAWWWWKKKK((((1111))))      FFFFrrrreeeeeeee SSSSooooffffttttwwwwaaaarrrreeee FFFFoooouuuunnnnddddaaaattttiiiioooonnnn ((((AAAApppprrrr 11118888 1111999999994444))))       GGGGAAAAWWWWKKKK((((1111))))
  928.  
  929.  
  930.  
  931.                       separated with blanks.  $$$$1111 is the value of the
  932.                       _g_e_t_u_i_d(2) system call, $$$$2222 is the value of the
  933.                       _g_e_t_e_u_i_d(2) system call, $$$$3333 is the value of the
  934.                       _g_e_t_g_i_d(2) system call, and $$$$4444 is the value of
  935.                       the _g_e_t_e_g_i_d(2) system call.  If there are any
  936.                       additional fields, they are the group IDs
  937.                       returned by _g_e_t_g_r_o_u_p_s(2).  Multiple groups may
  938.                       not be supported on all systems.
  939.  
  940.           ////ddddeeeevvvv////ssssttttddddiiiinnnn  The standard input.
  941.  
  942.           ////ddddeeeevvvv////ssssttttddddoooouuuutttt The standard output.
  943.  
  944.           ////ddddeeeevvvv////ssssttttddddeeeerrrrrrrr The standard error output.
  945.  
  946.           ////ddddeeeevvvv////ffffdddd////_n   The file associated with the open file
  947.                       descriptor _n.
  948.  
  949.           These are particularly useful for error messages. For
  950.           example:
  951.  
  952.                pppprrrriiiinnnntttt """"YYYYoooouuuu bbbblllleeeewwww iiiitttt!!!!"""" >>>> """"////ddddeeeevvvv////ssssttttddddeeeerrrrrrrr""""
  953.  
  954.           whereas you would otherwise have to use
  955.  
  956.                pppprrrriiiinnnntttt """"YYYYoooouuuu bbbblllleeeewwww iiiitttt!!!!"""" |||| """"ccccaaaatttt 1111>>>>&&&&2222""""
  957.  
  958.           These file names may also be used on the command line to
  959.           name data files.
  960.  
  961.         NNNNuuuummmmeeeerrrriiiicccc FFFFuuuunnnnccccttttiiiioooonnnnssss
  962.           AWK has the following pre-defined arithmetic functions:
  963.  
  964.           aaaattttaaaannnn2222((((_y,,,, _x)))) returns the arctangent of _y/_x in radians.
  965.  
  966.           ccccoooossss((((_e_x_p_r))))   returns the cosine in radians.
  967.  
  968.           eeeexxxxpppp((((_e_x_p_r))))   the exponential function.
  969.  
  970.           iiiinnnntttt((((_e_x_p_r))))   truncates to integer.
  971.  
  972.           lllloooogggg((((_e_x_p_r))))   the natural logarithm function.
  973.  
  974.           rrrraaaannnndddd(((())))      returns a random number between 0 and 1.
  975.  
  976.           ssssiiiinnnn((((_e_x_p_r))))   returns the sine in radians.
  977.  
  978.           ssssqqqqrrrrtttt((((_e_x_p_r))))  the square root function.
  979.  
  980.           ssssrrrraaaannnndddd((((_e_x_p_r)))) use _e_x_p_r as a new seed for the random number
  981.                       generator. If no _e_x_p_r is provided, the time of
  982.                       day will be used.  The return value is the
  983.  
  984.  
  985.  
  986.      Page 15                                         (printed 7/11/94)
  987.  
  988.  
  989.  
  990.  
  991.  
  992.  
  993.      GGGGAAAAWWWWKKKK((((1111))))      FFFFrrrreeeeeeee SSSSooooffffttttwwwwaaaarrrreeee FFFFoooouuuunnnnddddaaaattttiiiioooonnnn ((((AAAApppprrrr 11118888 1111999999994444))))       GGGGAAAAWWWWKKKK((((1111))))
  994.  
  995.  
  996.  
  997.                       previous seed for the random number generator.
  998.  
  999.         SSSSttttrrrriiiinnnngggg FFFFuuuunnnnccccttttiiiioooonnnnssss
  1000.           AWK has the following pre-defined string functions:
  1001.  
  1002.           ggggssssuuuubbbb((((_r,,,, _s,,,, _t))))           for each substring matching the
  1003.                                   regular expression _r in the string
  1004.                                   _t, substitute the string _s, and
  1005.                                   return the number of substitutions.
  1006.                                   If _t is not supplied, use $$$$0000.
  1007.  
  1008.           iiiinnnnddddeeeexxxx((((_s,,,, _t))))             returns the index of the string _t in
  1009.                                   the string _s, or 0 if _t is not
  1010.                                   present.
  1011.  
  1012.           lllleeeennnnggggtttthhhh((((_s))))               returns the length of the string _s,
  1013.                                   or the length of $$$$0000 if _s is not
  1014.                                   supplied.
  1015.  
  1016.           mmmmaaaattttcccchhhh((((_s,,,, _r))))             returns the position in _s where the
  1017.                                   regular expression _r occurs, or 0 if
  1018.                                   _r is not present, and sets the
  1019.                                   values of RRRRSSSSTTTTAAAARRRRTTTT and RRRRLLLLEEEENNNNGGGGTTTTHHHH.
  1020.  
  1021.           sssspppplllliiiitttt((((_s,,,, _a,,,, _r))))          splits the string _s into the array _a
  1022.                                   on the regular expression _r, and
  1023.                                   returns the number of fields. If _r
  1024.                                   is omitted, FFFFSSSS is used instead.  The
  1025.                                   array _a is cleared first.
  1026.  
  1027.           sssspppprrrriiiinnnnttttffff((((_f_m_t,,,, _e_x_p_r-_l_i_s_t)))) prints _e_x_p_r-_l_i_s_t according to _f_m_t,
  1028.                                   and returns the resulting string.
  1029.  
  1030.           ssssuuuubbbb((((_r,,,, _s,,,, _t))))            just like ggggssssuuuubbbb(((()))), but only the first
  1031.                                   matching substring is replaced.
  1032.  
  1033.           ssssuuuubbbbssssttttrrrr((((_s,,,, _i,,,, _n))))         returns the _n-character substring of
  1034.                                   _s starting at _i.  If _n is omitted,
  1035.                                   the rest of _s is used.
  1036.  
  1037.           ttttoooolllloooowwwweeeerrrr((((_s_t_r))))            returns a copy of the string _s_t_r,
  1038.                                   with all the upper-case characters
  1039.                                   in _s_t_r translated to their
  1040.                                   corresponding lower-case
  1041.                                   counterparts.  Non-alphabetic
  1042.                                   characters are left unchanged.
  1043.  
  1044.           ttttoooouuuuppppppppeeeerrrr((((_s_t_r))))            returns a copy of the string _s_t_r,
  1045.                                   with all the lower-case characters
  1046.                                   in _s_t_r translated to their
  1047.                                   corresponding upper-case
  1048.                                   counterparts.  Non-alphabetic
  1049.  
  1050.  
  1051.  
  1052.      Page 16                                         (printed 7/11/94)
  1053.  
  1054.  
  1055.  
  1056.  
  1057.  
  1058.  
  1059.      GGGGAAAAWWWWKKKK((((1111))))      FFFFrrrreeeeeeee SSSSooooffffttttwwwwaaaarrrreeee FFFFoooouuuunnnnddddaaaattttiiiioooonnnn ((((AAAApppprrrr 11118888 1111999999994444))))       GGGGAAAAWWWWKKKK((((1111))))
  1060.  
  1061.  
  1062.  
  1063.                                   characters are left unchanged.
  1064.  
  1065.         TTTTiiiimmmmeeee FFFFuuuunnnnccccttttiiiioooonnnnssss
  1066.           Since one of the primary uses of AWK programs is processing
  1067.           log files that contain time stamp information, _g_a_w_k provides
  1068.           the following two functions for obtaining time stamps and
  1069.           formatting them.
  1070.  
  1071.           ssssyyyyssssttttiiiimmmmeeee(((()))) returns the current time of day as the number of
  1072.                     seconds since the Epoch (Midnight UTC, January 1,
  1073.                     1970 on POSIX systems).
  1074.  
  1075.           ssssttttrrrrffffttttiiiimmmmeeee((((_f_o_r_m_a_t, _t_i_m_e_s_t_a_m_p))))
  1076.                     formats _t_i_m_e_s_t_a_m_p according to the specification
  1077.                     in _f_o_r_m_a_t.  The _t_i_m_e_s_t_a_m_p should be of the same
  1078.                     form as returned by ssssyyyyssssttttiiiimmmmeeee(((()))).  If _t_i_m_e_s_t_a_m_p is
  1079.                     missing, the current time of day is used.  See the
  1080.                     specification for the ssssttttrrrrffffttttiiiimmmmeeee(((()))) function in ANSI
  1081.                     C for the format conversions that are guaranteed
  1082.                     to be available.  A public-domain version of
  1083.                     _s_t_r_f_t_i_m_e(3) and a man page for it are shipped with
  1084.                     _g_a_w_k; if that version was used to build _g_a_w_k, then
  1085.                     all of the conversions described in that man page
  1086.                     are available to _g_a_w_k.
  1087.  
  1088.         SSSSttttrrrriiiinnnngggg CCCCoooonnnnssssttttaaaannnnttttssss
  1089.           String constants in AWK are sequences of characters enclosed
  1090.           between double quotes (""""). Within strings, certain _e_s_c_a_p_e
  1091.           _s_e_q_u_e_n_c_e_s are recognized, as in C. These are:
  1092.  
  1093.           \\\\\\\\   A literal backslash.
  1094.  
  1095.           \\\\aaaa   The ``alert'' character; usually the ASCII BEL
  1096.                character.
  1097.  
  1098.           \\\\bbbb   backspace.
  1099.  
  1100.           \\\\ffff   form-feed.
  1101.  
  1102.           \\\\nnnn   new line.
  1103.  
  1104.           \\\\rrrr   carriage return.
  1105.  
  1106.           \\\\tttt   horizontal tab.
  1107.  
  1108.           \\\\vvvv   vertical tab.
  1109.  
  1110.           \\\\xxxx_h_e_x _d_i_g_i_t_s
  1111.                The character represented by the string of hexadecimal
  1112.                digits following the \\\\xxxx.  As in ANSI C, all following
  1113.                hexadecimal digits are considered part of the escape
  1114.                sequence.  (This feature should tell us something about
  1115.  
  1116.  
  1117.  
  1118.      Page 17                                         (printed 7/11/94)
  1119.  
  1120.  
  1121.  
  1122.  
  1123.  
  1124.  
  1125.      GGGGAAAAWWWWKKKK((((1111))))      FFFFrrrreeeeeeee SSSSooooffffttttwwwwaaaarrrreeee FFFFoooouuuunnnnddddaaaattttiiiioooonnnn ((((AAAApppprrrr 11118888 1111999999994444))))       GGGGAAAAWWWWKKKK((((1111))))
  1126.  
  1127.  
  1128.  
  1129.                language design by committee.) E.g., """"\\\\xxxx1111BBBB"""" is the
  1130.                ASCII ESC (escape) character.
  1131.  
  1132.           \\\\_d_d_d The character represented by the 1-, 2-, or 3-digit
  1133.                sequence of octal digits. E.g. """"\\\\000033333333"""" is the ASCII ESC
  1134.                (escape) character.
  1135.  
  1136.           \\\\_c   The literal character _c.
  1137.  
  1138.           The escape sequences may also be used inside constant
  1139.           regular expressions (e.g., ////[[[[ \\\\tttt\\\\ffff\\\\nnnn\\\\rrrr\\\\vvvv]]]]//// matches
  1140.           whitespace characters).
  1141.  
  1142.      FFFFUUUUNNNNCCCCTTTTIIIIOOOONNNNSSSS
  1143.           Functions in AWK are defined as follows:
  1144.  
  1145.                ffffuuuunnnnccccttttiiiioooonnnn _n_a_m_e((((_p_a_r_a_m_e_t_e_r _l_i_s_t)))) {{{{ _s_t_a_t_e_m_e_n_t_s }}}}
  1146.  
  1147.           Functions are executed when called from within the action
  1148.           parts of regular pattern-action statements. Actual
  1149.           parameters supplied in the function call are used to
  1150.           instantiate the formal parameters declared in the function.
  1151.           Arrays are passed by reference, other variables are passed
  1152.           by value.
  1153.  
  1154.           Since functions were not originally part of the AWK
  1155.           language, the provision for local variables is rather
  1156.           clumsy: They are declared as extra parameters in the
  1157.           parameter list. The convention is to separate local
  1158.           variables from real parameters by extra spaces in the
  1159.           parameter list. For example:
  1160.  
  1161.                ffffuuuunnnnccccttttiiiioooonnnn  ffff((((pppp,,,, qqqq,,,,     aaaa,,,, bbbb)))) {{{{ #### aaaa &&&& bbbb aaaarrrreeee llllooooccccaaaallll
  1162.                               .................... }}}}
  1163.  
  1164.                ////aaaabbbbcccc////     {{{{ ............ ;;;; ffff((((1111,,,, 2222)))) ;;;; ............ }}}}
  1165.  
  1166.           The left parenthesis in a function call is required to
  1167.           immediately follow the function name, without any
  1168.           intervening white space.  This is to avoid a syntactic
  1169.           ambiguity with the concatenation operator.  This restriction
  1170.           does not apply to the built-in functions listed above.
  1171.  
  1172.           Functions may call each other and may be recursive.
  1173.           Function parameters used as local variables are initialized
  1174.           to the null string and the number zero upon function
  1175.           invocation.
  1176.  
  1177.           The word ffffuuuunnnncccc may be used in place of ffffuuuunnnnccccttttiiiioooonnnn.
  1178.  
  1179.      EEEEXXXXAAAAMMMMPPPPLLLLEEEESSSS
  1180.           Print and sort the login names of all users:
  1181.  
  1182.  
  1183.  
  1184.      Page 18                                         (printed 7/11/94)
  1185.  
  1186.  
  1187.  
  1188.  
  1189.  
  1190.  
  1191.      GGGGAAAAWWWWKKKK((((1111))))      FFFFrrrreeeeeeee SSSSooooffffttttwwwwaaaarrrreeee FFFFoooouuuunnnnddddaaaattttiiiioooonnnn ((((AAAApppprrrr 11118888 1111999999994444))))       GGGGAAAAWWWWKKKK((((1111))))
  1192.  
  1193.  
  1194.  
  1195.                BBBBEEEEGGGGIIIINNNN     {{{{ FFFFSSSS ==== """"::::"""" }}}}
  1196.                     {{{{ pppprrrriiiinnnntttt $$$$1111 |||| """"ssssoooorrrrtttt"""" }}}}
  1197.  
  1198.           Count lines in a file:
  1199.  
  1200.                     {{{{ nnnnlllliiiinnnneeeessss++++++++ }}}}
  1201.                EEEENNNNDDDD  {{{{ pppprrrriiiinnnntttt nnnnlllliiiinnnneeeessss }}}}
  1202.  
  1203.           Precede each line by its number in the file:
  1204.  
  1205.                {{{{ pppprrrriiiinnnntttt FFFFNNNNRRRR,,,, $$$$0000 }}}}
  1206.  
  1207.           Concatenate and line number (a variation on a theme):
  1208.  
  1209.                {{{{ pppprrrriiiinnnntttt NNNNRRRR,,,, $$$$0000 }}}}
  1210.  
  1211.      SSSSEEEEEEEE AAAALLLLSSSSOOOO
  1212.           _e_g_r_e_p(1), _g_e_t_p_i_d(2), _g_e_t_p_p_i_d(2), _g_e_t_p_g_r_p(2), _g_e_t_u_i_d(2),
  1213.           _g_e_t_e_u_i_d(2), _g_e_t_g_i_d(2), _g_e_t_e_g_i_d(2), _g_e_t_g_r_o_u_p_s(2)
  1214.  
  1215.           _T_h_e _A_W_K _P_r_o_g_r_a_m_m_i_n_g _L_a_n_g_u_a_g_e, Alfred V. Aho, Brian W.
  1216.           Kernighan, Peter J. Weinberger, Addison-Wesley, 1988. ISBN
  1217.           0-201-07981-X.
  1218.  
  1219.           _T_h_e _G_A_W_K _M_a_n_u_a_l, Edition 0.15, published by the Free
  1220.           Software Foundation, 1993.
  1221.  
  1222.      PPPPOOOOSSSSIIIIXXXX CCCCOOOOMMMMPPPPAAAATTTTIIIIBBBBIIIILLLLIIIITTTTYYYY
  1223.           A primary goal for _g_a_w_k is compatibility with the POSIX
  1224.           standard, as well as with the latest version of UNIX _a_w_k.
  1225.           To this end, _g_a_w_k incorporates the following user visible
  1226.           features which are not described in the AWK book, but are
  1227.           part of _a_w_k in System V Release 4, and are in the POSIX
  1228.           standard.
  1229.  
  1230.           The ----vvvv option for assigning variables before program
  1231.           execution starts is new.  The book indicates that command
  1232.           line variable assignment happens when _a_w_k would otherwise
  1233.           open the argument as a file, which is after the BBBBEEEEGGGGIIIINNNN block
  1234.           is executed.  However, in earlier implementations, when such
  1235.           an assignment appeared before any file names, the assignment
  1236.           would happen _b_e_f_o_r_e the BBBBEEEEGGGGIIIINNNN block was run.  Applications
  1237.           came to depend on this ``feature.'' When _a_w_k was changed to
  1238.           match its documentation, this option was added to
  1239.           accommodate applications that depended upon the old
  1240.           behavior.  (This feature was agreed upon by both the AT&T
  1241.           and GNU developers.)
  1242.  
  1243.           The ----WWWW option for implementation specific features is from
  1244.           the POSIX standard.
  1245.  
  1246.           When processing arguments, _g_a_w_k uses the special option
  1247.  
  1248.  
  1249.  
  1250.      Page 19                                         (printed 7/11/94)
  1251.  
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.      GGGGAAAAWWWWKKKK((((1111))))      FFFFrrrreeeeeeee SSSSooooffffttttwwwwaaaarrrreeee FFFFoooouuuunnnnddddaaaattttiiiioooonnnn ((((AAAApppprrrr 11118888 1111999999994444))))       GGGGAAAAWWWWKKKK((((1111))))
  1258.  
  1259.  
  1260.  
  1261.           ``--------'' to signal the end of arguments.  In compatibility
  1262.           mode, it will warn about, but otherwise ignore, undefined
  1263.           options.  In normal operation, such arguments are passed on
  1264.           to the AWK program for it to process.
  1265.  
  1266.           The AWK book does not define the return value of ssssrrrraaaannnndddd(((()))).
  1267.           The System V Release 4 version of UNIX _a_w_k (and the POSIX
  1268.           standard) has it return the seed it was using, to allow
  1269.           keeping track of random number sequences. Therefore ssssrrrraaaannnndddd(((())))
  1270.           in _g_a_w_k also returns its current seed.
  1271.  
  1272.           Other new features are: The use of multiple ----ffff options (from
  1273.           MKS _a_w_k); the EEEENNNNVVVVIIIIRRRROOOONNNN array; the \\\\aaaa, and \\\\vvvv escape sequences
  1274.           (done originally in _g_a_w_k and fed back into AT&T's); the
  1275.           ttttoooolllloooowwwweeeerrrr(((()))) and ttttoooouuuuppppppppeeeerrrr(((()))) built-in functions (from AT&T); and
  1276.           the ANSI C conversion specifications in pppprrrriiiinnnnttttffff (done first
  1277.           in AT&T's version).
  1278.  
  1279.      GGGGNNNNUUUU EEEEXXXXTTTTEEEENNNNSSSSIIIIOOOONNNNSSSS
  1280.           _G_a_w_k has some extensions to POSIX _a_w_k.  They are described
  1281.           in this section.  All the extensions described here can be
  1282.           disabled by invoking _g_a_w_k with the ----WWWW ccccoooommmmppppaaaatttt option.
  1283.  
  1284.           The following features of _g_a_w_k are not available in POSIX
  1285.           _a_w_k.
  1286.  
  1287.                o+ The \\\\xxxx escape sequence.
  1288.  
  1289.                o+ The ssssyyyyssssttttiiiimmmmeeee(((()))) and ssssttttrrrrffffttttiiiimmmmeeee(((()))) functions.
  1290.  
  1291.                o+ The special file names available for I/O redirection
  1292.                  are not recognized.
  1293.  
  1294.                o+ The AAAARRRRGGGGIIIINNNNDDDD and EEEERRRRRRRRNNNNOOOO variables are not special.
  1295.  
  1296.                o+ The IIIIGGGGNNNNOOOORRRREEEECCCCAAAASSSSEEEE variable and its side-effects are not
  1297.                  available.
  1298.  
  1299.                o+ The FFFFIIIIEEEELLLLDDDDWWWWIIIIDDDDTTTTHHHHSSSS variable and fixed width field
  1300.                  splitting.
  1301.  
  1302.                o+ No path search is performed for files named via the
  1303.                  ----ffff option.  Therefore the AAAAWWWWKKKKPPPPAAAATTTTHHHH environment
  1304.                  variable is not special.
  1305.  
  1306.                o+ The use of nnnneeeexxxxtttt ffffiiiilllleeee to abandon processing of the
  1307.                  current input file.
  1308.  
  1309.                o+ The use of ddddeeeelllleeeetttteeee _a_r_r_a_y to delete the entire contents
  1310.                  of an array.
  1311.  
  1312.           The AWK book does not define the return value of the cccclllloooosssseeee(((())))
  1313.  
  1314.  
  1315.  
  1316.      Page 20                                         (printed 7/11/94)
  1317.  
  1318.  
  1319.  
  1320.  
  1321.  
  1322.  
  1323.      GGGGAAAAWWWWKKKK((((1111))))      FFFFrrrreeeeeeee SSSSooooffffttttwwwwaaaarrrreeee FFFFoooouuuunnnnddddaaaattttiiiioooonnnn ((((AAAApppprrrr 11118888 1111999999994444))))       GGGGAAAAWWWWKKKK((((1111))))
  1324.  
  1325.  
  1326.  
  1327.           function.  _G_a_w_k's cccclllloooosssseeee(((()))) returns the value from _f_c_l_o_s_e(3),
  1328.           or _p_c_l_o_s_e(3), when closing a file or pipe, respectively.
  1329.  
  1330.           When _g_a_w_k is invoked with the ----WWWW ccccoooommmmppppaaaatttt option, if the _f_s
  1331.           argument to the ----FFFF option is ``t'', then FFFFSSSS will be set to
  1332.           the tab character.  Since this is a rather ugly special
  1333.           case, it is not the default behavior.  This behavior also
  1334.           does not occur if ----WWWW ppppoooossssiiiixxxx has been specified.
  1335.  
  1336.      HHHHIIIISSSSTTTTOOOORRRRIIIICCCCAAAALLLL FFFFEEEEAAAATTTTUUUURRRREEEESSSS
  1337.           There are two features of historical AWK implementations
  1338.           that _g_a_w_k supports.  First, it is possible to call the
  1339.           lllleeeennnnggggtttthhhh(((()))) built-in function not only with no argument, but
  1340.           even without parentheses!  Thus,
  1341.  
  1342.                aaaa ==== lllleeeennnnggggtttthhhh
  1343.  
  1344.           is the same as either of
  1345.  
  1346.                aaaa ==== lllleeeennnnggggtttthhhh(((())))
  1347.                aaaa ==== lllleeeennnnggggtttthhhh(((($$$$0000))))
  1348.  
  1349.           This feature is marked as ``deprecated'' in the POSIX
  1350.           standard, and _g_a_w_k will issue a warning about its use if ----WWWW
  1351.           lllliiiinnnntttt is specified on the command line.
  1352.  
  1353.           The other feature is the use of the ccccoooonnnnttttiiiinnnnuuuueeee statement
  1354.           outside the body of a wwwwhhhhiiiilllleeee, ffffoooorrrr, or ddddoooo loop.  Traditional
  1355.           AWK implementations have treated such usage as equivalent to
  1356.           the nnnneeeexxxxtttt statement.  _G_a_w_k will support this usage if ----WWWW
  1357.           ppppoooossssiiiixxxx has not been specified.
  1358.  
  1359.      EEEENNNNVVVVIIIIRRRROOOONNNNMMMMEEEENNNNTTTT VVVVAAAARRRRIIIIAAAABBBBLLLLEEEESSSS
  1360.           If PPPPOOOOSSSSIIIIXXXXLLLLYYYY____CCCCOOOORRRRRRRREEEECCCCTTTT exists in the environment, then _g_a_w_k
  1361.           behaves exactly as if --------ppppoooossssiiiixxxx had been specified on the
  1362.           command line.  If --------lllliiiinnnntttt has been specified, _g_a_w_k will issue
  1363.           a warning message to this effect.
  1364.  
  1365.      BBBBUUUUGGGGSSSS
  1366.           The ----FFFF option is not necessary given the command line
  1367.           variable assignment feature; it remains only for backwards
  1368.           compatibility.
  1369.  
  1370.           If your system actually has support for ////ddddeeeevvvv////ffffdddd and the
  1371.           associated ////ddddeeeevvvv////ssssttttddddiiiinnnn, ////ddddeeeevvvv////ssssttttddddoooouuuutttt, and ////ddddeeeevvvv////ssssttttddddeeeerrrrrrrr files,
  1372.           you may get different output from _g_a_w_k than you would get on
  1373.           a system without those files.  When _g_a_w_k interprets these
  1374.           files internally, it synchronizes output to the standard
  1375.           output with output to ////ddddeeeevvvv////ssssttttddddoooouuuutttt, while on a system with
  1376.           those files, the output is actually to different open files.
  1377.           Caveat Emptor.
  1378.  
  1379.  
  1380.  
  1381.  
  1382.      Page 21                                         (printed 7/11/94)
  1383.  
  1384.  
  1385.  
  1386.  
  1387.  
  1388.  
  1389.      GGGGAAAAWWWWKKKK((((1111))))      FFFFrrrreeeeeeee SSSSooooffffttttwwwwaaaarrrreeee FFFFoooouuuunnnnddddaaaattttiiiioooonnnn ((((AAAApppprrrr 11118888 1111999999994444))))       GGGGAAAAWWWWKKKK((((1111))))
  1390.  
  1391.  
  1392.  
  1393.      VVVVEEEERRRRSSSSIIIIOOOONNNN IIIINNNNFFFFOOOORRRRMMMMAAAATTTTIIIIOOOONNNN
  1394.           This man page documents _g_a_w_k, version 2.15.
  1395.  
  1396.           Starting with the 2.15 version of _g_a_w_k, the ----cccc, ----VVVV, ----CCCC, ----aaaa,
  1397.           and ----eeee options of the 2.11 version are no longer recognized.
  1398.           This fact will not even be documented in the manual page for
  1399.           version 2.16.
  1400.  
  1401.      AAAAUUUUTTTTHHHHOOOORRRRSSSS
  1402.           The original version of UNIX _a_w_k was designed and
  1403.           implemented by Alfred Aho, Peter Weinberger, and Brian
  1404.           Kernighan of AT&T Bell Labs. Brian Kernighan continues to
  1405.           maintain and enhance it.
  1406.  
  1407.           Paul Rubin and Jay Fenlason, of the Free Software
  1408.           Foundation, wrote _g_a_w_k, to be compatible with the original
  1409.           version of _a_w_k distributed in Seventh Edition UNIX.  John
  1410.           Woods contributed a number of bug fixes.  David Trueman,
  1411.           with contributions from Arnold Robbins, made _g_a_w_k compatible
  1412.           with the new version of UNIX _a_w_k.
  1413.  
  1414.           The initial DOS port was done by Conrad Kwok and Scott
  1415.           Garfinkle.  Scott Deifik is the current DOS maintainer.  Pat
  1416.           Rankin did the port to VMS, and Michal Jaegermann did the
  1417.           port to the Atari ST.  The port to OS/2 was done by Kai Uwe
  1418.           Rommel, with contributions and help from Darrel Hankerson.
  1419.  
  1420.      AAAACCCCKKKKNNNNOOOOWWWWLLLLEEEEDDDDGGGGEEEEMMMMEEEENNNNTTTTSSSS
  1421.           Brian Kernighan of Bell Labs provided valuable assistance
  1422.           during testing and debugging.  We thank him.
  1423.  
  1424.  
  1425.  
  1426.  
  1427.  
  1428.  
  1429.  
  1430.  
  1431.  
  1432.  
  1433.  
  1434.  
  1435.  
  1436.  
  1437.  
  1438.  
  1439.  
  1440.  
  1441.  
  1442.  
  1443.  
  1444.  
  1445.  
  1446.  
  1447.  
  1448.      Page 22                                         (printed 7/11/94)
  1449.  
  1450.  
  1451.  
  1452.